<%@ Page Language="VB" MasterPageFile="~/Template.master" AutoEventWireup="false" CodeFile="AddEditArticle.aspx.vb" Inherits="Admin_AddEditArticle" title="Add Article" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
   <div class="sectiontitle">
      <asp:Literal runat="server" ID="lblNewArticle" Text="Post New Article" />
      <asp:Literal runat="server" ID="lblEditArticle" Text="Edit Article" Visible="false" />
   </div>
   <p></p>
   <asp:DetailsView ID="dvwArticle" runat="server" AutoGenerateDeleteButton="True"
        AutoGenerateEditButton="True" AutoGenerateInsertButton="True" AutoGenerateRows="False"
        DataKeyNames="ID" DataSourceID="objCurrArticle" DefaultMode="Insert" HeaderText="Article Details"
        Height="50px" Width="425px">
        <Fields>
         <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
            SortExpression="ID" />
         <asp:BoundField DataField="madeby" HeaderText="Added By" InsertVisible="False" ReadOnly="True"
            SortExpression="madeby" />
 
         <asp:TemplateField HeaderText="Subject" SortExpression="subject">
            <ItemTemplate>
               <asp:Label ID="lblsubject" runat="server" Text='<%# Eval("subject") %>'></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
               <asp:TextBox ID="txtsubject" runat="server" Text='<%# Bind("subject") %>' Width="100%" MaxLength="256"></asp:TextBox>
               <asp:RequiredFieldValidator ID="valRequireTitle" runat="server" ControlToValidate="txtsubject" SetFocusOnError="true"
                  Text="The subject field is required." ToolTip="The subject field is required." Display="Dynamic"></asp:RequiredFieldValidator>
            </EditItemTemplate>
         </asp:TemplateField>
         <asp:TemplateField HeaderText="Message" SortExpression="">
            <ItemTemplate>
               <asp:Label ID="lblmessage" runat="server" Text='<%# Eval("message") %>'></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
               <asp:TextBox ID="txtmessage" runat="server" Text='<%# Bind("message") %>' Rows="5" TextMode="MultiLine" Width="100%" MaxLength="4000"></asp:TextBox>
            </EditItemTemplate>
         </asp:TemplateField>
        </Fields>
        <FieldHeaderStyle Width="100px" />
    </asp:DetailsView>
    <asp:ObjectDataSource ID="objCurrArticle" runat="server" TypeName="MB.PsychCal.BLL.Articles.Article" 
        InsertMethod="InsertArticle" SelectMethod="GetArticleByID">
        <SelectParameters>
            <asp:QueryStringParameter Name="announcementid" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
        
         <asp:Parameter Name="subject" Type="String" ConvertEmptyStringToNull="false" />
         <asp:Parameter Name="message" Type="String" ConvertEmptyStringToNull="false" />

        </InsertParameters>
    </asp:ObjectDataSource>
    <p></p>
</asp:Content>


